classdef spyfilt_gradnorm < spyview_filter
    properties (Constant=true)
        name='GradNorm';
        description='Magnitude of gradient';
        parameters=[];
    end
    methods
        function [pm,px,py]=filter(sf,pm,px,py)    
            pmx=diff(pm,[],2);
            px=(px(1:(end-1))+px(2:end))/2;
            pmy=diff(pm,[],1);
            py=(py(1:(end-1))+py(2:end))/2;
            pm=sqrt(pmx(1:end-1,:).^2 + pmy(:,1:end-1).^2);
        end
    end
end